
import Opt from '@/components/dt/info/Opt.js'
import table from '@/components/dt/table/render.js'
let _this = null,
  sourceWhere = ''

class Column extends Opt {
  constructor(vm, source) {
    console.log(source, 'visible');
    super()
    _this = vm
    sourceWhere = source
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    let arrColumn = []
    if(sourceWhere === 'protect') {
      arrColumn = [
        {
          field: 'createTime',
          title: '操作时间',
        },
        {
          field: 'buildingStatusName',
          title: '案场类型',
        },
        {
          field: 'orgNames',
          title: '公司范围',
        }, 
        {
          field: 'operationContent',
          title: '记录内容',
        }, 
        {
          field: 'operationTypeName',
          title: '操作',
        }, 
      ]
    }
    if(sourceWhere === 'rob' || sourceWhere === 'buildRob') {
      arrColumn = [
        {
          field: 'createTime',
          title: '操作时间',
        },
        {
          field: 'operationContent',
          title: '记录内容',
          minWidth: 300
        }, 
      ]
    }

    this.all = [
      {
        field: 'createName',
        title: '操作人',
      },
      ...arrColumn
    ]
  }

}

export default Column